From 2cc8cfa0ea713d0961b36dc27368f0d0727cc78f Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 15 Feb 2004 23:05:48 +0000 Subject: [PATCH] Split declaration and assignment of combo_box. Mon Feb 16 00:04:46 2004 Matthias Clasen * gtk/gtkcombobox.c (gtk_combo_box_cell_layout_*): Split declaration and assignment of combo_box. * gtk/gtkcombobox.c (gtk_combo_box_list_setup): Remove a pointless cast --- ChangeLog | 8 +++++ ChangeLog.pre-2-10 | 8 +++++ ChangeLog.pre-2-4 | 8 +++++ ChangeLog.pre-2-6 | 8 +++++ ChangeLog.pre-2-8 | 8 +++++ gtk/gtkcombobox.c | 73 ++++++++++++++++++++++++++++++++++------------ 6 files changed, 95 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1d2d5491e0..b15f62d343 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Mon Feb 16 00:04:46 2004 Matthias Clasen + + * gtk/gtkcombobox.c (gtk_combo_box_cell_layout_*): + Split declaration and assignment of combo_box. + + * gtk/gtkcombobox.c (gtk_combo_box_list_setup): Remove a + pointless cast + Sun Feb 15 22:08:53 2004 Matthias Clasen * gtk/gtkoptionmenu.c (gtk_option_menu_get_history): Add diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 1d2d5491e0..b15f62d343 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,11 @@ +Mon Feb 16 00:04:46 2004 Matthias Clasen + + * gtk/gtkcombobox.c (gtk_combo_box_cell_layout_*): + Split declaration and assignment of combo_box. + + * gtk/gtkcombobox.c (gtk_combo_box_list_setup): Remove a + pointless cast + Sun Feb 15 22:08:53 2004 Matthias Clasen * gtk/gtkoptionmenu.c (gtk_option_menu_get_history): Add diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 1d2d5491e0..b15f62d343 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,11 @@ +Mon Feb 16 00:04:46 2004 Matthias Clasen + + * gtk/gtkcombobox.c (gtk_combo_box_cell_layout_*): + Split declaration and assignment of combo_box. + + * gtk/gtkcombobox.c (gtk_combo_box_list_setup): Remove a + pointless cast + Sun Feb 15 22:08:53 2004 Matthias Clasen * gtk/gtkoptionmenu.c (gtk_option_menu_get_history): Add diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 1d2d5491e0..b15f62d343 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,11 @@ +Mon Feb 16 00:04:46 2004 Matthias Clasen + + * gtk/gtkcombobox.c (gtk_combo_box_cell_layout_*): + Split declaration and assignment of combo_box. + + * gtk/gtkcombobox.c (gtk_combo_box_list_setup): Remove a + pointless cast + Sun Feb 15 22:08:53 2004 Matthias Clasen * gtk/gtkoptionmenu.c (gtk_option_menu_get_history): Add diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 1d2d5491e0..b15f62d343 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,11 @@ +Mon Feb 16 00:04:46 2004 Matthias Clasen + + * gtk/gtkcombobox.c (gtk_combo_box_cell_layout_*): + Split declaration and assignment of combo_box. + + * gtk/gtkcombobox.c (gtk_combo_box_list_setup): Remove a + pointless cast + Sun Feb 15 22:08:53 2004 Matthias Clasen * gtk/gtkoptionmenu.c (gtk_option_menu_get_history): Add diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c index 19fce2eff4..5253e37097 100644 --- a/gtk/gtkcombobox.c +++ b/gtk/gtkcombobox.c @@ -161,8 +161,6 @@ static void gtk_combo_box_menu_position (GtkMenu *menu, gint *y, gint *push_in, gpointer user_data); -static void gtk_combo_box_popup (GtkComboBox *combo_box); -static void gtk_combo_box_popdown (GtkComboBox *combo_box); static gint gtk_combo_box_calc_requested_width (GtkComboBox *combo_box, GtkTreePath *path); @@ -746,12 +744,25 @@ gtk_combo_box_menu_position (GtkMenu *menu, *push_in = TRUE; } -static void +/** + * gtk_combo_box_popup: + * @combo_box: a #GtkComboBox + * + * Pops up the menu or dropdown list of @combo_box. + * + * This function is mostly intended for use by accessibility technologies; + * applications should have little use for it. + * + * Since: 2.4 + **/ +void gtk_combo_box_popup (GtkComboBox *combo_box) { gint x, y, width, height; GtkWidget *sample; + g_return_if_fail (GTK_IS_COMBO_BOX (combo_box)); + if (GTK_WIDGET_MAPPED (combo_box->priv->popup_widget)) return; @@ -818,9 +829,22 @@ gtk_combo_box_popup (GtkComboBox *combo_box) } } -static void +/** + * gtk_combo_box_popdown: + * @combo_box: a #GtkComboBox + * + * Hides the menu or dropdown list of @combo_box. + * + * This function is mostly intended for use by accessibility technologies; + * applications should have little use for it. + * + * Since: 2.4 + **/ +void gtk_combo_box_popdown (GtkComboBox *combo_box) { + g_return_if_fail (GTK_IS_COMBO_BOX (combo_box)); + if (GTK_IS_MENU (combo_box->priv->popup_widget)) { gtk_menu_popdown (GTK_MENU (combo_box->priv->popup_widget)); @@ -1823,8 +1847,7 @@ gtk_combo_box_list_setup (GtkComboBox *combo_box) } /* set sample/popup widgets */ - gtk_combo_box_set_popup_widget (GTK_COMBO_BOX (combo_box), - combo_box->priv->tree_view); + gtk_combo_box_set_popup_widget (combo_box, combo_box->priv->tree_view); gtk_widget_show (combo_box->priv->tree_view); } @@ -2048,12 +2071,14 @@ gtk_combo_box_cell_layout_pack_start (GtkCellLayout *layout, gboolean expand) { ComboCellInfo *info; - GtkComboBox *combo_box = GTK_COMBO_BOX (layout); + GtkComboBox *combo_box; GtkWidget *menu; - g_return_if_fail (GTK_IS_COMBO_BOX (combo_box)); + g_return_if_fail (GTK_IS_COMBO_BOX (layout)); g_return_if_fail (GTK_IS_CELL_RENDERER (cell)); + combo_box = GTK_COMBO_BOX (layout); + info = g_new0 (ComboCellInfo, 1); info->cell = cell; info->expand = expand; @@ -2095,12 +2120,14 @@ gtk_combo_box_cell_layout_pack_end (GtkCellLayout *layout, gboolean expand) { ComboCellInfo *info; - GtkComboBox *combo_box = GTK_COMBO_BOX (layout); + GtkComboBox *combo_box; GtkWidget *menu; - g_return_if_fail (GTK_IS_COMBO_BOX (combo_box)); + g_return_if_fail (GTK_IS_COMBO_BOX (layout)); g_return_if_fail (GTK_IS_CELL_RENDERER (cell)); + combo_box = GTK_COMBO_BOX (layout); + info = g_new0 (ComboCellInfo, 1); info->cell = cell; info->expand = expand; @@ -2138,11 +2165,13 @@ static void gtk_combo_box_cell_layout_clear (GtkCellLayout *layout) { GtkWidget *menu; - GtkComboBox *combo_box = GTK_COMBO_BOX (layout); + GtkComboBox *combo_box; GSList *i; - g_return_if_fail (GTK_IS_COMBO_BOX (combo_box)); + g_return_if_fail (GTK_IS_COMBO_BOX (layout)); + combo_box = GTK_COMBO_BOX (layout); + if (combo_box->priv->cell_view) gtk_cell_layout_clear (GTK_CELL_LAYOUT (combo_box->priv->cell_view)); @@ -2188,12 +2217,14 @@ gtk_combo_box_cell_layout_add_attribute (GtkCellLayout *layout, gint column) { ComboCellInfo *info; - GtkComboBox *combo_box = GTK_COMBO_BOX (layout); + GtkComboBox *combo_box; GtkWidget *menu; - g_return_if_fail (GTK_IS_COMBO_BOX (combo_box)); + g_return_if_fail (GTK_IS_COMBO_BOX (layout)); g_return_if_fail (GTK_IS_CELL_RENDERER (cell)); + combo_box = GTK_COMBO_BOX (layout); + info = gtk_combo_box_get_cell_info (combo_box, cell); info->attributes = g_slist_prepend (info->attributes, @@ -2241,10 +2272,12 @@ gtk_combo_box_cell_layout_set_cell_data_func (GtkCellLayout *layout, GDestroyNotify destroy) { ComboCellInfo *info; - GtkComboBox *combo_box = GTK_COMBO_BOX (layout); + GtkComboBox *combo_box; GtkWidget *menu; - g_return_if_fail (GTK_IS_COMBO_BOX (combo_box)); + g_return_if_fail (GTK_IS_COMBO_BOX (layout)); + + combo_box = GTK_COMBO_BOX (layout); info = gtk_combo_box_get_cell_info (combo_box, cell); g_return_if_fail (info != NULL); @@ -2296,13 +2329,15 @@ gtk_combo_box_cell_layout_clear_attributes (GtkCellLayout *layout, GtkCellRenderer *cell) { ComboCellInfo *info; - GtkComboBox *combo_box = GTK_COMBO_BOX (layout); + GtkComboBox *combo_box; GtkWidget *menu; GSList *list; g_return_if_fail (GTK_IS_COMBO_BOX (layout)); g_return_if_fail (GTK_IS_CELL_RENDERER (cell)); + combo_box = GTK_COMBO_BOX (layout); + info = gtk_combo_box_get_cell_info (combo_box, cell); g_return_if_fail (info != NULL); @@ -2350,13 +2385,15 @@ gtk_combo_box_cell_layout_reorder (GtkCellLayout *layout, gint position) { ComboCellInfo *info; - GtkComboBox *combo_box = GTK_COMBO_BOX (layout); + GtkComboBox *combo_box; GtkWidget *menu; GSList *link; g_return_if_fail (GTK_IS_COMBO_BOX (layout)); g_return_if_fail (GTK_IS_CELL_RENDERER (cell)); + combo_box = GTK_COMBO_BOX (layout); + info = gtk_combo_box_get_cell_info (combo_box, cell); g_return_if_fail (info != NULL); -- 2.30.2